#主菜单Trigger Enable
scoreboard players enable @a[tag=!NoMultiMenu] MultiMenu
tag @a[tag=Gaming] add NoMultiMenu
tag @a[tag=!Gaming] remove NoMultiMenu
#Set MultiM=1
execute as @a[tag=!En,tag=!NoMultiMenu,tag=!MultiMenuAlready,nbt={SelectedItem:{id:"minecraft:knowledge_book",tag:{display:{Name:"{\"bold\":true,\"italic\":false,\"color\":\"gold\",\"text\":\"多功能菜单\"}",Lore:["{\"italic\":false,\"text\":\"在物品栏选定以展开个人菜单\"}"]}}}}] at @s run scoreboard players set @s MultiMenu 1
#MultiM at BackPack (26)
item replace entity @a[tag=!En,tag=MultM_to_Bpck,tag=!NoMultiMenu] container.26 with minecraft:knowledge_book{display:{Name:"{\"bold\":true,\"italic\":false,\"color\":\"gold\",\"text\":\"多功能菜单\"}",Lore:["{\"italic\":false,\"text\":\"在物品栏选定以展开个人菜单\"}"]}}
#MultiM at Invent (8)
item replace entity @a[tag=!En,tag=!MultM_to_Bpck,tag=!NoMultiMenu] container.8 with minecraft:knowledge_book{display:{Name:"{\"bold\":true,\"italic\":false,\"color\":\"gold\",\"text\":\"多功能菜单\"}",Lore:["{\"italic\":false,\"text\":\"在物品栏选定以展开个人菜单\"}"]}}
#Add MultiMAlready
execute as @a[tag=!En,tag=!MultiMenuAlready,nbt={SelectedItem:{id:"minecraft:knowledge_book",tag:{display:{Name:"{\"bold\":true,\"italic\":false,\"color\":\"gold\",\"text\":\"多功能菜单\"}",Lore:["{\"italic\":false,\"text\":\"在物品栏选定以展开个人菜单\"}"]}}}}] at @s run tag @s add MultiMenuAlready
#Remove MultiMAlready
execute as @a[tag=!En,nbt=!{SelectedItem:{id:"minecraft:knowledge_book",tag:{display:{Name:"{\"bold\":true,\"italic\":false,\"color\":\"gold\",\"text\":\"多功能菜单\"}",Lore:["{\"italic\":false,\"text\":\"在物品栏选定以展开个人菜单\"}"]}}}}] at @s run tag @s remove MultiMenuAlready
#Anti-Throw
kill @e[type=item,nbt={Item:{id:"minecraft:knowledge_book",Count:1b,tag:{display:{Name:"{\"bold\":true,\"italic\":false,\"color\":\"gold\",\"text\":\"多功能菜单\"}",Lore:["{\"italic\":false,\"text\":\"在物品栏选定以展开个人菜单\"}"]}}}}]

#Set MultiM=1
execute as @a[tag=En,tag=!NoMultiMenu,tag=!MultiMenuAlready,nbt={SelectedItem:{id:"minecraft:knowledge_book",tag:{display:{Name:"{\"bold\":true,\"italic\":false,\"color\":\"gold\",\"text\":\"MultiMenu\"}",Lore:["{\"italic\":false,\"text\":\"Select in Inventory to open MultiMenu main page\"}"]}}}}] at @s run scoreboard players set @s MultiMenu 1
#MultiM at BackPack (26)
item replace entity @a[tag=En,tag=MultM_to_Bpck,tag=!NoMultiMenu] container.26 with minecraft:knowledge_book{display:{Name:"{\"bold\":true,\"italic\":false,\"color\":\"gold\",\"text\":\"MultiMenu\"}",Lore:["{\"italic\":false,\"text\":\"Select in Inventory to open MultiMenu main page\"}"]}}
#MultiM at Invent (8)
item replace entity @a[tag=En,tag=!MultM_to_Bpck,tag=!NoMultiMenu] container.8 with minecraft:knowledge_book{display:{Name:"{\"bold\":true,\"italic\":false,\"color\":\"gold\",\"text\":\"MultiMenu\"}",Lore:["{\"italic\":false,\"text\":\"Select in Inventory to open MultiMenu main page\"}"]}}
#Add MultiMAlready
execute as @a[tag=En,tag=!MultiMenuAlready,nbt={SelectedItem:{id:"minecraft:knowledge_book",tag:{display:{Name:"{\"bold\":true,\"italic\":false,\"color\":\"gold\",\"text\":\"MultiMenu\"}",Lore:["{\"italic\":false,\"text\":\"Select in Inventory to open MultiMenu main page\"}"]}}}}] at @s run tag @s add MultiMenuAlready
#Remove MultiMAlready
execute as @a[tag=En,nbt=!{SelectedItem:{id:"minecraft:knowledge_book",tag:{display:{Name:"{\"bold\":true,\"italic\":false,\"color\":\"gold\",\"text\":\"MultiMenu\"}",Lore:["{\"italic\":false,\"text\":\"Select in Inventory to open MultiMenu main page\"}"]}}}}] at @s run tag @s remove MultiMenuAlready
#Anti-Throw
kill @e[type=item,nbt={Item:{id:"minecraft:knowledge_book",Count:1b,tag:{display:{Name:"{\"bold\":true,\"italic\":false,\"color\":\"gold\",\"text\":\"MultiMenu\"}",Lore:["{\"italic\":false,\"text\":\"Select in Inventory to open MultiMenu main page\"}"]}}}}]